﻿namespace GoodAdmin.System;

public interface IBaseService
{

    /// <summary>
    /// 根据请求的api获取接口权限
    /// </summary>
    /// <returns></returns>
    Task<ApiRole> GetUserApiRoleByRequest();
    /// <summary>
    /// 根据请求的api获取接口权限中的组织id列表
    /// </summary>
    /// <returns></returns>
    Task<List<long>> GetUserApiRoleOrgIdByRequest();

    /// <summary>
    /// 获取当前登录用户接口权限
    /// </summary>
    /// <returns></returns>
    Task<List<ApiRole>> GetUserApiRoles();

    /// <summary>
    /// 获取公共角色接口权限
    /// </summary>
    /// <returns></returns>
    Task<ApiRole> GetCommonApiRoleByRequest();
    /// <summary>
    /// 检查数据范围
    /// </summary>
    /// <param name="OrgId"></param>
    /// <param name="UserId"></param>
    /// <returns></returns>
    Task CheckDataScope(long OrgId, long UserId = 0);

    /// <summary>
    /// 检查数据范围
    /// </summary>
    /// <param name="OrgIdList"></param>
    /// <param name="UserId"></param>
    /// <returns></returns>
    Task CheckDataScope(List<long> OrgIdList, long UserId = 0);
}
